Release 10.1A: OpenEdge Data Management:
DataServer for Microsoft SQL Server


Replacing FIND FIRST for performance

When coding 4GL applications for the DataServer, FIND FIRST statements can often be replaced with other 4GL statements to greatly improve performance. OPEN QUERYs and dynamic FINDs are significantly more efficient. Likewise, using FOR FIRST in place of FIND FIRST can improve performance when retrieving a single record with NO-LOCK. For example, if your application uses the following FIND FIRST code:

FIND FIRST tablename WHERE where-clause NO-LOCK. 

The code can be replaced with the following for significant performance gains:

FOR FIRST tablename WHERE where-clause NO-LOCK:
END. 

In the case of the FOR FIRST, the record is available beyond the end of the FOR FIRST loop. Similar performance advantages can be gained when retrieving last record as well.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095